home *** CD-ROM | disk | FTP | other *** search
/ Team Palmtops 7 / Palmtops_numero07.iso / WinCE / SDKWindowsCE / HandHeldPCPro30 / sdk.exe / Jupiter SDK / data1.cab / MFC_Samples / propdlg / stylepge.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1999-02-19  |  2.5 KB  |  85 lines

  1. // stylepge.cpp : implementation file
  2. //
  3. // This is a part of the Microsoft Foundation Classes C++ library.
  4. // Copyright (C) 1999 Microsoft Corporation
  5. // All rights reserved.
  6. //
  7. // This source code is only intended as a supplement to the
  8. // Microsoft Foundation Classes Reference and related
  9. // electronic documentation provided with the library.
  10. // See these sources for detailed information regarding the
  11. // Microsoft Foundation Classes product.
  12.  
  13. #include "stdafx.h"
  14. #include "propdlg.h"
  15. #include "stylepge.h"
  16. #include "colorpge.h"
  17. #include "shapeobj.h"
  18. #include "propsht.h"
  19. #include "propsht2.h"
  20.  
  21.  
  22. #ifdef _DEBUG
  23. #undef THIS_FILE
  24. static char BASED_CODE THIS_FILE[] = __FILE__;
  25. #endif
  26.  
  27. /////////////////////////////////////////////////////////////////////////////
  28. // CStylePage dialog
  29.  
  30. CStylePage::CStylePage() : CPropertyPage(CStylePage::IDD)
  31. {
  32.     //{{AFX_DATA_INIT(CStylePage)
  33.     //}}AFX_DATA_INIT
  34.     m_nShapeStyle = rectangle;
  35. }
  36.  
  37. void CStylePage::DoDataExchange(CDataExchange* pDX)
  38. {
  39.     CPropertyPage::DoDataExchange(pDX);
  40.     //{{AFX_DATA_MAP(CStylePage)
  41.     DDX_Radio(pDX, IDC_RECTANGLE, m_nShapeStyle);
  42.     //}}AFX_DATA_MAP
  43. }
  44.  
  45. void CStylePage::OnStyleClicked(UINT /*nCmdID*/)
  46. {
  47.     // The CStylePage property page is used for both the
  48.     // CModalShapePropSheet and the CModelessShapePropSheet.
  49.     // Both these versions of the property sheet share a common
  50.     // feature that they immediately update a shape.  In the
  51.     // case of CModalShapePropSheet, the shape is in the preview
  52.     // window.  In the case of CModelessShapePropSheet, the shape
  53.     // is the currently selected shape in the view.
  54.  
  55.     CPropertySheet* pSheet = (CPropertySheet*)GetParent();
  56.  
  57.     CModalShapePropSheet* pModalSheet = 
  58.         DYNAMIC_DOWNCAST(CModalShapePropSheet, pSheet);
  59.     if (pModalSheet != NULL)
  60.     {
  61.         UpdateData();
  62.         SetModified(); // enable Apply Now button
  63.     }
  64.  
  65.     CModelessShapePropSheet* pModelessSheet = 
  66.         DYNAMIC_DOWNCAST(CModelessShapePropSheet, pSheet);
  67.     if (pModelessSheet != NULL)
  68.     {
  69.         UpdateData();
  70.         CFrameWnd* pFrameWnd = STATIC_DOWNCAST(CFrameWnd, AfxGetMainWnd());
  71.         CView* pView = pFrameWnd->GetActiveFrame()->GetActiveView();
  72.         pView->SendMessage(WM_USER_CHANGE_OBJECT_PROPERTIES, 0, 0);
  73.     }
  74. }
  75.  
  76. BEGIN_MESSAGE_MAP(CStylePage, CPropertyPage)
  77.     ON_CONTROL_RANGE(BN_CLICKED, IDC_RECTANGLE, IDC_ELLIPSE, OnStyleClicked)
  78.     //{{AFX_MSG_MAP(CStylePage)
  79.         // NOTE: the ClassWizard will add message map macros here
  80.     //}}AFX_MSG_MAP
  81. END_MESSAGE_MAP()
  82.  
  83. /////////////////////////////////////////////////////////////////////////////
  84. // CStylePage message handlers
  85.